package com.biz.primus.app.rest.feign.order;

import com.biz.primus.app.rest.degraded.order.DegradedReturnOrderFeignClient;
import com.biz.primus.model.order.vo.aftersale.*;
import com.biz.primus.model.order.vo.request.OrderCodeVO;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * ReturnOrderFeignClient
 *
 * @author Tiger Feng
 * @date 2017年11月24日
 */
@FeignClient(qualifier = "returnOrderFeignClient", name = "service-order", fallback = DegradedReturnOrderFeignClient.class)
public interface ReturnOrderFeignClient {

    //@ApiOperation(value = "查询订单信息以用于售后服务", notes = "根据订单编码获取订单信息，以便用于售后界面展示")
    @GetMapping("soa/orderService/returnOrder/queryByOrderCode4AfterSale")
    QueryOrderResponseVO queryByOrderCode4AfterSale(
            @RequestBody OrderCodeVO orderCodeVO);

    //@ApiOperation(value = "申请退货单", notes = "申请创建退货单")
    @PostMapping("soa/orderService/returnOrder/applyReturnOrder")
    ReturnOrderResponseVO applyReturnOrder(
            @RequestBody ReturnOrderRequestVO returnOrderRequestVO);

    //@ApiOperation(value = "查询退货单", notes = "根据订单编码获取退货单，当前订单的退货单，一个订单只能有一个退货单")
    @GetMapping("soa/orderService/returnOrder/queryByOrderCode")
    ReturnOrderResponseVO queryByOrderCode(
            @RequestBody OrderCodeVO orderCodeVO);

    //@ApiOperation(value = "补充退货单物流信息", notes = "用户将退货商品回寄的物流单号、物流名称等信息补充到退货单中")
    @PostMapping("soa/orderService/returnOrder/addLogisticsInfo")
    ReturnOrderResponseVO addLogisticsInfo(
            @RequestBody ReturnOrderAddLogisticsRequestVO returnOrderAddLogisticsRequestVO);

    //@ApiOperation(value = "取消退货单", notes = "用户取消退货单，需要传入退货单,成功返回true")
    @PostMapping("soa/orderService/returnOrder/cancelReturnOrder")
    Boolean cancelReturnOrder(
            @RequestBody ReturnCodeVO returnCodeVO);

}
